package com.atguigu.tingshu.es.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "person")
public class Person {
    @Id
    private Long id;
    @Field(name = "name", type = FieldType.Keyword)
    private String name;
    @Field(name = "age", type = FieldType.Integer)
    private Integer age;
    @Field(name = "address", type = FieldType.Text, analyzer = "ik_max_word")
    private String address;
}
